package cz.muni.pa036.hockeyStats;

/***********************************************************************
 * Module:  Penalties.java
 * Author:  Rojko
 * Purpose: Defines the Class Penalties
 ***********************************************************************/

/** @pdOid 9ad34a9c-16ee-4752-a9de-9778a439ae8b */
public class Penalties {
   /** @pdOid 351c2b15-e439-4fdd-8a5a-ad2e5d592e7a */
   public int idPenalty;
   /** @pdOid 49798173-c242-443b-84f4-e13d9a6a5333 */
   public java.lang.String penaltyName;
   
   /** @pdRoleInfo migr=no name=GamePenalties assc=relationship14 coll=java.util.Collection impl=java.util.HashSet mult=0..* type=Composition side=A */
   public java.util.Collection<GamePenalties> gamePenalties;
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<GamePenalties> getGamePenalties() {
      if (gamePenalties == null)
         gamePenalties = new java.util.HashSet<GamePenalties>();
      return gamePenalties;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorGamePenalties() {
      if (gamePenalties == null)
         gamePenalties = new java.util.HashSet<GamePenalties>();
      return gamePenalties.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newGamePenalties */
   public void setGamePenalties(java.util.Collection<GamePenalties> newGamePenalties) {
      removeAllGamePenalties();
      for (java.util.Iterator iter = newGamePenalties.iterator(); iter.hasNext();)
         addGamePenalties((GamePenalties)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newGamePenalties */
   public void addGamePenalties(GamePenalties newGamePenalties) {
      if (newGamePenalties == null)
         return;
      if (this.gamePenalties == null)
         this.gamePenalties = new java.util.HashSet<GamePenalties>();
      if (!this.gamePenalties.contains(newGamePenalties))
         this.gamePenalties.add(newGamePenalties);
   }
   
   /** @pdGenerated default remove
     * @param oldGamePenalties */
   public void removeGamePenalties(GamePenalties oldGamePenalties) {
      if (oldGamePenalties == null)
         return;
      if (this.gamePenalties != null)
         if (this.gamePenalties.contains(oldGamePenalties))
            this.gamePenalties.remove(oldGamePenalties);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllGamePenalties() {
      if (gamePenalties != null)
         gamePenalties.clear();
   }

}